package com.company.thread;

/**
 * @description: some desc
 * @author: ruoan
 * @date: 2020/10/23 14:17
 */
public class MyThread5 {


    //待决中断

    public static void main(String[] args) {
        if (args.length > 0) {
            Thread.currentThread().interrupt();
        }
        System.out.println("haha");
        try{
            long startTime = System.currentTimeMillis();

            Thread.sleep(2000);
            System.out.println("was NOT interrupted");
        }catch(InterruptedException x){
            System.out.println("was interrupted");
        }
        long endTime = System.currentTimeMillis();
        //System.out.println("代码执行时间"+(endTime-startTime));

    }
}
